package com.mrzhang.common.config;

import com.mrzhang.common.handler.GlptAccessDeniedHandler;
import com.mrzhang.common.handler.GlptAuthExceptionEntryPoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

public class GlptAuthExceptionConfig {
    @Bean
    @ConditionalOnMissingBean(name = "accessDeniedHandler")
    public GlptAccessDeniedHandler accessDeniedHandler() {
        return new GlptAccessDeniedHandler();
    }

    @Bean
    @ConditionalOnMissingBean(name = "authenticationEntryPoint")
    public GlptAuthExceptionEntryPoint authenticationEntryPoint() {
        return new GlptAuthExceptionEntryPoint();
    }
}
